#pragma once
#ifndef myResManager_h__
#define myResManager_h__

#include "../inc/sky.h"
#include "../inc/myMessage.h"
#include "../inc/skyPict.h"
#include "../inc/skyFont.h"
#include "../inc/skyFile.h"
#include "../inc/skyCanvas.h"
#include "../inc/skyPainter.h"
namespace Sky
{
	class myApplet;
	class myResMgr : private TreeNode
	{
	public:
		myResMgr():TreeNode(){}

		Bool createPictFromFile(Pict* pict,String* file,PictManager::Callback doneCallback = vNull);
		Bool createPictFromBuffer(Pict* pict,Buffer* buffer,PictManager::Callback doneCallback = vNull);
		Bool createPictFromRawBuffer(Pict* pict,Buffer* buffer,PictManager::Callback doneCallback = vNull);

		Bool createFont(Font* font,String* fontName = vNull,i32 weight = 0,i32 width = 0,i32 height = 0);

		Bool createFile(File* file,String* name,File::OpenMode flag = File::modeReadWrite);

		Bool createCanvas();

		Bool createPainter();

		Void setMeidaDirectory(String* mediaDirectory);

		virtual myApplet*	getApplication();
	private:
		String _mediaDir;
	};
}
#endif // myIResManager_h__
